package com.woniuxy.movie.cinema.controller;

import com.woniuxy.movie.cinema.service.CinemaSeatService;
import com.woniuxy.movie.commons.core.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "测试相关接口")
public class MovieHallController {

    @Autowired
    private CinemaSeatService cinemaSeatService;

    @GetMapping("/movieHallTest")
    @ApiOperation("影院测试接口")
    public Result<String> movieHallTest() {
        return Result.getResult(String.class).setData("cinema-service");
    }


    /*int t =0;
    int cont =0;
    Long start = null;*/
    @GetMapping("/test")
    public String test(String test) {
        /*if (start==null) {
            start = System.currentTimeMillis();
        }
        cont++;
        if (System.currentTimeMillis()-start>=1000){
            System.out.println("第"+(++t)+"秒"+cont);
            cont = 0;
            start = System.currentTimeMillis();
        }*/
        return cinemaSeatService.test("xxxxxxxxxxxxxxxxx");
    }

    @GetMapping("/test1")
    public String test1() {
        return cinemaSeatService.test("yyyyyyyyyyyyyyy");
    }

}
